3.31 \(\int \frac{-1+2 a x}{\sqrt{-1+x} x^2 \sqrt{1+x}} \, dx\)

Optimal. Leaf size=39 \[ 2 a \tan ^{-1}\left (\sqrt{x-1} \sqrt{x+1}\right )-\frac{\sqrt{x-1} \sqrt{x+1}}{x} \]

[Out]

-((Sqrt[-1 + x]*Sqrt[1 + x])/x) + 2*a*ArcTan[Sqrt[-1 + x]*Sqrt[1 + x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0074949, antiderivative size = 39, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {151, 12, 92, 203} \[ 2 a \tan ^{-1}\left (\sqrt{x-1} \sqrt{x+1}\right )-\frac{\sqrt{x-1} \sqrt{x+1}}{x} \]

Antiderivative was successfully verified.

[In]

Int[(-1 + 2*a*x)/(Sqrt[-1 + x]*x^2*Sqrt[1 + x]),x]

[Out]

-((Sqrt[-1 + x]*Sqrt[1 + x])/x) + 2*a*ArcTan[Sqrt[-1 + x]*Sqrt[1 + x]]

Rule 151

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_)*((g_.) + (h_.)*(x_)), x_Symb
ol] :> Simp[((b*g - a*h)*(a + b*x)^(m + 1)*(c + d*x)^(n + 1)*(e + f*x)^(p + 1))/((m + 1)*(b*c - a*d)*(b*e - a*
f)), x] + Dist[1/((m + 1)*(b*c - a*d)*(b*e - a*f)), Int[(a + b*x)^(m + 1)*(c + d*x)^n*(e + f*x)^p*Simp[(a*d*f*
g - b*(d*e + c*f)*g + b*c*e*h)*(m + 1) - (b*g - a*h)*(d*e*(n + 1) + c*f*(p + 1)) - d*f*(b*g - a*h)*(m + n + p
+ 3)*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, g, h, n, p}, x] && LtQ[m, -1] && IntegerQ[m]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 92

Int[1/(Sqrt[(a_.) + (b_.)*(x_)]*Sqrt[(c_.) + (d_.)*(x_)]*((e_.) + (f_.)*(x_))), x_Symbol] :> Dist[b*f, Subst[I
nt[1/(d*(b*e - a*f)^2 + b*f^2*x^2), x], x, Sqrt[a + b*x]*Sqrt[c + d*x]], x] /; FreeQ[{a, b, c, d, e, f}, x] &&
 EqQ[2*b*d*e - f*(b*c + a*d), 0]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{-1+2 a x}{\sqrt{-1+x} x^2 \sqrt{1+x}} \, dx &=-\frac{\sqrt{-1+x} \sqrt{1+x}}{x}+\int \frac{2 a}{\sqrt{-1+x} x \sqrt{1+x}} \, dx\\ &=-\frac{\sqrt{-1+x} \sqrt{1+x}}{x}+(2 a) \int \frac{1}{\sqrt{-1+x} x \sqrt{1+x}} \, dx\\ &=-\frac{\sqrt{-1+x} \sqrt{1+x}}{x}+(2 a) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\sqrt{-1+x} \sqrt{1+x}\right )\\ &=-\frac{\sqrt{-1+x} \sqrt{1+x}}{x}+2 a \tan ^{-1}\left (\sqrt{-1+x} \sqrt{1+x}\right )\\ \end{align*}

Mathematica [A]  time = 0.0147942, size = 48, normalized size = 1.23 \[ \frac{2 a \sqrt{x^2-1} x \tan ^{-1}\left (\sqrt{x^2-1}\right )-x^2+1}{\sqrt{x-1} x \sqrt{x+1}} \]

Antiderivative was successfully verified.

[In]

Integrate[(-1 + 2*a*x)/(Sqrt[-1 + x]*x^2*Sqrt[1 + x]),x]

[Out]

(1 - x^2 + 2*a*x*Sqrt[-1 + x^2]*ArcTan[Sqrt[-1 + x^2]])/(Sqrt[-1 + x]*x*Sqrt[1 + x])

________________________________________________________________________________________

Maple [A]  time = 0.015, size = 44, normalized size = 1.1 \begin{align*}{\frac{1}{x} \left ( -2\,ax\arctan \left ({\frac{1}{\sqrt{{x}^{2}-1}}} \right ) -\sqrt{{x}^{2}-1} \right ) \sqrt{-1+x}\sqrt{1+x}{\frac{1}{\sqrt{{x}^{2}-1}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((2*a*x-1)/x^2/(-1+x)^(1/2)/(1+x)^(1/2),x)

[Out]

(-2*a*x*arctan(1/(x^2-1)^(1/2))-(x^2-1)^(1/2))*(-1+x)^(1/2)*(1+x)^(1/2)/x/(x^2-1)^(1/2)

________________________________________________________________________________________

Maxima [A]  time = 3.18987, size = 28, normalized size = 0.72 \begin{align*} -2 \, a \arcsin \left (\frac{1}{{\left | x \right |}}\right ) - \frac{\sqrt{x^{2} - 1}}{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2*a*x-1)/x^2/(-1+x)^(1/2)/(1+x)^(1/2),x, algorithm="maxima")

[Out]

-2*a*arcsin(1/abs(x)) - sqrt(x^2 - 1)/x

________________________________________________________________________________________

Fricas [A]  time = 1.3243, size = 104, normalized size = 2.67 \begin{align*} \frac{4 \, a x \arctan \left (\sqrt{x + 1} \sqrt{x - 1} - x\right ) - \sqrt{x + 1} \sqrt{x - 1} - x}{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2*a*x-1)/x^2/(-1+x)^(1/2)/(1+x)^(1/2),x, algorithm="fricas")

[Out]

(4*a*x*arctan(sqrt(x + 1)*sqrt(x - 1) - x) - sqrt(x + 1)*sqrt(x - 1) - x)/x

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2*a*x-1)/x**2/(-1+x)**(1/2)/(1+x)**(1/2),x)

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Giac [A]  time = 1.86463, size = 58, normalized size = 1.49 \begin{align*} -4 \, a \arctan \left (\frac{1}{2} \,{\left (\sqrt{x + 1} - \sqrt{x - 1}\right )}^{2}\right ) - \frac{8}{{\left (\sqrt{x + 1} - \sqrt{x - 1}\right )}^{4} + 4} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2*a*x-1)/x^2/(-1+x)^(1/2)/(1+x)^(1/2),x, algorithm="giac")

[Out]

-4*a*arctan(1/2*(sqrt(x + 1) - sqrt(x - 1))^2) - 8/((sqrt(x + 1) - sqrt(x - 1))^4 + 4)